﻿using Ay.Framework.WPF;
using MPSystem.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MPSystem.Views.ZCYL
{
    /// <summary>
    /// System_para_Computer.xaml 的交互逻辑
    /// </summary>
    public partial class System_para_Computer : Page
    {
        public System_para_Computer()
        {
            InitializeComponent();
        }

        /// <summary>
        /// 80%*3.14*直径*直径*强度/4/1000
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (mm.Text.Trim() == "" || mpa.Text.Trim() == "") {
                AyMessageBox.ShowError("必须填写2个参数!" );
                return;
            };
             
            double x = 0.8 *3.14* AyCommon.ToDouble(mm.Text.Trim()) * AyCommon.ToFloat(mm.Text.Trim()) * AyCommon.ToFloat(mpa.Text.Trim()) / 4.0 / 1000.0;
            ConditonsModel.Name = x.ToString();
            this.CloseParentWindow();
        }
    }
}
